// components/good-item-evaluate/good-item-evaluate.js
Component({

  options: {
    addGlobalClass: true,//使用app.wxss样式
    styleIsolation: 'shared'
  },

  /**
   * 组件的属性列表
   */
  properties: {
    goods: {
      type: Object,
      //监听数据变化
      observer(newVal,oldVal,changedPath){
          this.setData({ goods: newVal });
      }
    },
    commentInfo: {
      type: Object,
      //监听数据变化
      observer(newVal,oldVal,changedPath){
        if(Object.keys(newVal).length != 0) {//数据不为空
          this.setData({
            commentInfo: newVal,
            commentList: newVal.pageUtils.rows,
            levelList: newVal.levelList,
          });
        }
      }
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    commentInfo: {},
    commentList: [],
    levelList: [],
    goods: {},
  },

  /**
   * 组件的方法列表
   */
  methods: {
    jumpCommentList:function(){
      wx.navigateTo({
        url: '/subIndex/index/commentList/commentList?productId=' + this.data.goods.id,
      })
    },
  }
})
